package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.service.INursingProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.Get;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.server.PathParam;

/**
 *@Author: 布莱恩
 *@Date: 2025/10/13 20:57
 *@Description:
 **/
@RestController
@RequestMapping("/member/orders/project")
@Api(tags = "小程序端护理项目接口")
public class MemberNursingProjectControllre {

    @Autowired
    private INursingProjectService nursingProjectService;

    /**
     * 分页查询护理项目列表
     * @param name
     * @param pageNum
     * @param pageSize
     * @param status
     * @return
     */
    @GetMapping("/page")
    @ApiOperation("分页查询护理项目列表")
    public TableDataInfo<NursingProject> getProjectList(String name, Integer pageNum, Integer pageSize, Integer status) {
        return nursingProjectService.pageByPageNumAndStatus(name, pageNum, pageSize, status);
    }

    /**
     * 查询护理项目详情
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    @ApiOperation("查询护理项目详情")
    public AjaxResult getProjectById(@PathVariable Long id){
        NursingProject nursingProject = nursingProjectService.selectNursingProjectById(id);
        return AjaxResult.success(nursingProject);
    }

}
